package com.example.AIstudy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.AIstudy.dao.TranslateDao;
import com.example.AIstudy.domain.TranslateDetail;
import com.example.AIstudy.exception.AIstudyException;
import com.example.AIstudy.service.TranslationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TranslationServiceImpl extends ServiceImpl<TranslateDao, TranslateDetail> implements TranslationService {

    @Autowired
    TranslateDao translateDao;
    @Override
    public void insertTranslateDetail(TranslateDetail translateDetail) throws AIstudyException {
        try{
            translateDao.insertTranslateDetail(translateDetail);
        }catch (Exception e){
            System.out.println(e.getMessage());
            throw new AIstudyException(AIstudyException.ErrorType.INSERT_ERROR,"添加习题失败");
        }
    }
}
